###############################
# Default settings for logstash
###############################

JAVA_HOME={{JAVA_HOME}}
# Override Java location
JAVACMD={{ logstash_javacmd }}

# Set a home directory
LS_HOME={{ logstash_home_dir|default('/var/lib/logstash') }}

# Arguments to pass to logstash agent
LS_OPTS="{{ logstash_opts|join(' ') }}"

# Arguments to pass to java
#LS_HEAP_SIZE="1g"
#LS_JAVA_OPTS="-Djava.io.tmpdir=$HOME"
{% if logstash_heap_size|default(false) %}
LS_HEAP_SIZE="{{ logstash_heap_size }}"
{% endif %}
{% if logstash_java_opts %}
LS_JAVA_OPTS="{{ logstash_java_opts|join(' ') }}"
{% endif %}

# pidfiles aren't used for upstart; this is for sysv users.
LS_PIDFILE={{ logstash_pid_dir }}/logstash.pid

# user id to be invoked as; for upstart: edit /etc/init/logstash.conf
LS_USER={{ logstash_user }}

# logstash logging
LS_LOG_FILE={{ logstash_log_dir }}/logstash.log
{# Note: Based on logic in bin/logstash.lib.sh any value passed to    #}
{#       LOGSTASH_USE_GC_LOGGING will enable GC logging (as of v2.2)  #}
{% if logstash_use_gc_logging %}
LS_USE_GC_LOGGING="true"
{% else %}
#LS_USE_GC_LOGGING="true"
{% endif %}

# logstash configuration directory
LS_CONF_DIR={{ logstash_conf_dir }}

# Open file limit; cannot be overridden in upstart
LS_OPEN_FILES={{ logstash_open_files }}

# Nice level
LS_NICE={{ logstash_nice|default('19') }}

# If this is set to 1, then when `stop` is called, if the process has
# not exited within a reasonable time, SIGKILL will be sent next.
# The default behavior is to simply log a message "program stop failed; still running"
KILL_ON_STOP_TIMEOUT={{ logstash_kill_on_stop_timeout|default('0') }}
